<template>
    <div>
        <h2>A组件</h2>
        <input type="text">
        <button @click="changB"> 到B组件</button>
        <button @click="changC"> 到C组件</button>
    </div>
</template>
<script>
   export default {
        name:'Acom',
        data() {
            return {
               
            };
        },
        methods: {
            changB(){
                this.$router.push("/B")
            },
            changC(){
                this.$router.push("/C")
            }
        },
        beforeRouteLeave(to,from,next){
            from.meta.keepAlive=true;
            next();
        },
        // beforeRouteEnter(){

        // },
        // beforeRouteUpdate(){

        // },
        
   };
</script>
<style scoped>

</style>